package bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="house")
@GenericGenerator(name="GENID", strategy="identity")
public class House implements java.io.Serializable{
	@Id
	@Column(name="ID")
	@GeneratedValue(generator="GENID")
	private Integer id;
	@ManyToOne
	@JoinColumn(name="USER_ID")
	@Fetch(FetchMode.JOIN)
	private User users;
	@ManyToOne
	@JoinColumn(name="Type_ID")
	@Fetch(FetchMode.JOIN)
	private Type type;
	@ManyToOne
	@JoinColumn(name="STREET_ID")
	@Fetch(FetchMode.JOIN)
	private Street street;
	@Column(name="TITLE")
	private String title;
	@Column(name="DESCRIPTION")
	private String description;
	@Column(name="PRICE")
	private Integer price;
	@Column(name="PUBDATE")
	private Date pubdate;
	@Column(name="FLOORAGE")
	private Integer floorage;
	@Column(name="CONTACT")
	private String contact;
	
	public House() {
		super();
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public User getUsers() {
		return users;
	}
	public void setUsers(User users) {
		this.users = users;
	}
	public Type getType() {
		return type;
	}
	public void setType(Type type) {
		this.type = type;
	}
	public Street getStreet() {
		return street;
	}
	public void setStreet(Street street) {
		this.street = street;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Integer getPrice() {
		return price;
	}
	public void setPrice(Integer price) {
		this.price = price;
	}
	public Date getPubdate() {
		return pubdate;
	}
	public void setPubdate(Date pubdate) {
		this.pubdate = pubdate;
	}
	public Integer getFloorage() {
		return floorage;
	}
	public void setFloorage(Integer floorage) {
		this.floorage = floorage;
	}
	public String getContact() {
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	@Override
	public String toString() {
		return "House [id=" + id + ", users=" + users + ", type=" + type + ", street=" + street + ", title=" + title
				+ ", description=" + description + ", price=" + price + ", pubdate=" + pubdate + ", floorage="
				+ floorage + ", contact=" + contact + "]";
	}
}
